export const minMax = (val, min, max) => {
  return Math.min(Math.max(val, min), max);
};

export const stringContains = (str, text) => {
  return str.indexOf(text) > -1;
};

export const is = {
  arr: a => Array.isArray(a),
  obj: a => stringContains(Object.prototype.toString.call(a), 'Object'),
  str: a => typeof a === 'string',
  fun: a => typeof a === 'function',
  und: a => typeof a === 'undefined',
  num: a => stringContains(Object.prototype.toString.call(a), 'Number') && !isNaN(a),
  nul: a => stringContains(Object.prototype.toString.call(a), 'Null'),
};
